Skip to content

[DO NOT MERGE] Local authority api with Fake results (leave in place for the moment) #4720

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

KludgeKML
Copy link
Contributor

@KludgeKML KludgeKML commented Mar 26, 2025

⚠️ This repo is Continuously Deployed: make sure you follow the guidance ⚠️

What

This is a version of this actual PR:
#4770

Why

to add dummy data so that this endpoint can be called from a preview app (which otherwise wouldn't work since they can't access locations-api or Local Links Manager)

- to house anything we need across multiple apis
- addresses_with_authority_data returns an array of the addresses with
  local authority slug and name, suitable for presenting from the app.
@KludgeKML KludgeKML force-pushed the local-authority-api branch from 6bc6a3c to 4bce952 Compare April 7, 2025 16:04
@govuk-ci govuk-ci temporarily deployed to govuk-frontend-app-pr-4720 April 7, 2025 16:04 Inactive
@govuk-ci govuk-ci temporarily deployed to govuk-frontend-app-pr-4720 April 7, 2025 19:22 Inactive
@govuk-ci govuk-ci temporarily deployed to govuk-frontend-app-pr-4720 April 7, 2025 19:30 Inactive
@govuk-ci govuk-ci temporarily deployed to govuk-frontend-app-pr-4720 April 7, 2025 19:34 Inactive
@KludgeKML KludgeKML force-pushed the local-authority-api branch from 64fab21 to 78f8134 Compare April 8, 2025 09:00
@govuk-ci govuk-ci temporarily deployed to govuk-frontend-app-pr-4720 April 8, 2025 09:01 Inactive
@KludgeKML KludgeKML force-pushed the local-authority-api branch from 78f8134 to 1662085 Compare April 8, 2025 09:12
@govuk-ci govuk-ci temporarily deployed to govuk-frontend-app-pr-4720 April 8, 2025 09:13 Inactive
@KludgeKML KludgeKML force-pushed the local-authority-api branch from 1662085 to 6b2e423 Compare April 8, 2025 09:30
@govuk-ci govuk-ci temporarily deployed to govuk-frontend-app-pr-4720 April 8, 2025 09:31 Inactive
@KludgeKML KludgeKML force-pushed the local-authority-api branch from 6b2e423 to 70315ec Compare April 8, 2025 09:36
@govuk-ci govuk-ci temporarily deployed to govuk-frontend-app-pr-4720 April 8, 2025 09:36 Inactive
@KludgeKML KludgeKML force-pushed the local-authority-api branch from 70315ec to 5ef72b1 Compare April 8, 2025 09:37
@govuk-ci govuk-ci temporarily deployed to govuk-frontend-app-pr-4720 April 8, 2025 09:37 Inactive
- this is genuinely an API, so rather than serving it as a separate format on the
  existing /find-local-council endpoint, we just make it its own thing, which
  allows us to restrict it / update it independently of the other controller. Since
  we've simplified the code in the existing find_local_council controller,
  the index method in the new controller is basically a direct copy of the
  find method - you're expected to call it with a query parameter, there isn't
  currently a simple index that lists all local authorities.
- the query is a GET - in the web interface it's a POST, but that's largely
  for privacy. The lookup is extremely cacheable at the CDN level - it might
  change less than one time a year - so we might as well take advantage
  of that.
- status codes are 301 (redirect straight to a local authority url to be added
  in a subsequent commit), 200 (a list of addresses to choose from if the postcode
  crosses boundaries), 404 (postcode is structurally valid but not found in the
  database), or 400 (postcode query parameter is missing or not valid).
- This is much simpler, at this point we're just doing slug lookups and returning
  a 404 or the local authority hash (including the parent hash if there is one).
@KludgeKML KludgeKML force-pushed the local-authority-api branch from 5ef72b1 to 1ce1a8d Compare April 8, 2025 09:53
@KludgeKML KludgeKML changed the title Local authority api Local authority api with Fake results (leave in place for the moment) Apr 23, 2025
@KludgeKML KludgeKML changed the title Local authority api with Fake results (leave in place for the moment) [DO NOT MERGE] Local authority api with Fake results (leave in place for the moment) Apr 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants